import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { userService } from "../../share/user.service";
import { User } from "../../share/user.model";
import { UserLogin } from './user-login.model';
import { Subject } from "rxjs/Subject";

@Injectable()
export class UserLoginService {
	// public subject: Subject<User> = new Subject<User>();
	//  let user=Observable.create();
	constructor(private http: Http) {
		// super();
	}
	loginUrl: string = "http://localhost:3200/api/user/login"
	login(user: User): Observable<UserLogin> {

		return this.http.get(this.loginUrl).map(res => res.json() as UserLogin, err => console.log("访问出错"));
	}

}